package actions;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import beans.UserDAO;

public class UserActionFindWhere implements UserAction {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) throws IOException {
	
		
		String minage=request.getParameter("minage");
		String maxage=request.getParameter("maxage");
		String sql="select * from user where user_age>"+minage+" and user_age<"+maxage;
		
		//从下面是正式从数据库中取出的数据，放在div4中
		List<Map<String, Object>> list5= null;
		UserDAO userDAO=new UserDAO();
		list5=userDAO.findwhere(sql);
		request.getSession().setAttribute("list5", list5);
		
		response.sendRedirect("findwhere.jsp");
		

	
	}

}
